ARM: GICv3 ITS: introduce host LPI array
authorAndre Przywara <andre.przywara@arm.com>
Fri, 7 Apr 2017 22:07:59 +0000 (23:07 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 7 Apr 2017 22:15:50 +0000 (15:15 -0700)
commitdcb6cb2636890db4b52d825b6659b31df5063a27
treed2d6227d05aec7bb42567e8ad36b540e88372018
parent14b27472a8dde48e87d23883fceb08703b48a3fb
ARM: GICv3 ITS: introduce host LPI array

The number of LPIs on a host can be potentially huge (millions),
although in practise will be mostly reasonable. So prematurely allocating
an array of struct irq_desc's for each LPI is not an option.
However Xen itself does not care about LPIs, as every LPI will be injected
into a guest (Dom0 for now).
Create a dense data structure (8 Bytes) for each LPI which holds just
enough information to determine the virtual IRQ number and the VCPU into
which the LPI needs to be injected.
Also to not artificially limit the number of LPIs, we create a 2-level
table for holding those structures.
This patch introduces functions to initialize these tables and to
create, lookup and destroy entries for a given LPI.
By using the naturally atomic access guarantee the native uint64_t data
type gives us, we allocate and access LPI information in a way that does
not require a lock.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/gic-v3-lpi.c
xen/include/asm-arm/gic_v3_its.h
xen/include/asm-arm/irq.h